//
//  NetManager.m
//  Lottery
//
//  Created by Lad on 12-12-7.
//  Copyright (c) 2012年 archermind. All rights reserved.
//

#import "NetManager.h"
@interface NetManager ()
{
	Reachability *_reachability;
}


@end

@implementation NetManager
DEF_SINGLETON();

- (id)init
{
	self = [super init];
	if (self)
	{
		_reachability = [Reachability reachabilityForInternetConnection];
		[_reachability startNotifier];
	}
	return self;
}

- (void)dealloc
{
	[_reachability startNotifier];
}

- (BOOL)isHaveNetWork
{
    NetworkStatus  networkStatus = [_reachability currentReachabilityStatus];
    if (networkStatus != kNotReachable)
    {
		return YES;
	}
	return NO;
}


- (BOOL)isWIFIConnected
{
	return [_reachability currentReachabilityStatus] == ReachableViaWiFi;
}

@end
